import _http from "@/utils/http";

export default {
  login(params, loading, headers) {
    return _http("post", {
      url: "/ums/w/company/login",
      apiName: "登录",
    }, params, loading, headers);
  },

  loginH5(params, loading, headers) {
    return _http("post", {
      url: "/ums/w/company/login/h5",
      apiName: "登录h5",
    }, params, loading, headers);
  },

  quit(params, loading) {
    return _http("post", {
      url: "/ums/w/company/quit",
      apiName: "退出登录",
    }, params, loading);
  },

  updatePassword(params, loading) {
    return _http("post", {
      url: "/ums/user/updatePwd/web",
      apiName: "登录后修改密码",
    }, params, loading);
  },

  captcha(params, loading) {
    return _http("get", {
      url: "/ums/auth/captcha.jpg",
      apiName: "生成验证码",
    }, params, loading);
  },

  getMsgCode(params, loading) {
    return _http("post", {
      url: "/ums/sms/getSmsCode",
      apiName: "获取验证码",
    }, params, loading);
  },

  register(params, loading) {
    return _http("post", {
      url: "/ums/register/app/shop",
      apiName: "注册",
    }, params, loading);
  },

  submitResetPwd(params, loading, headers) {
    return _http("post", {
      url: "/ums/user/forget/resetPwd/web",
      apiName: "忘记密码-重置密码",
    }, params, loading, headers);
  },

  confirmPwd(params, loading) {
    return _http("post", {
      url: "/ums/user/confirmPassword",
      apiName: "密码校验",
    }, params, loading);
  },

  checkName(params, loading) {
    return _http("post", {
      url: "/ums/register/checkName",
      apiName: "商铺名称校验",
    }, params, loading);
  },

  uploadImg(params, loading, headers) {
    return _http("post", {
      url: "/ums/file/upload/img",
      apiName: "图片上传",
    }, params, loading, headers);
  },

  livingCheck(params, loading) {
    return _http("post", {
      url: "/ums/user/sign/livingCheck/app",
      apiName: "APP实名授权申请",
    }, params, loading);
  },
  livingCheckH5(params, loading) {
    return _http("post", {
      url: "/ums/user/sign/livingCheck/web",
      apiName: "H5实名授权申请",
    }, params, loading);
  },

  livingResult(params, loading) {
    return _http("post", {
      url: "/ums/user/sign/livingResult",
      apiName: "查询实名授权结果",
    }, params, loading);
  },

  signNotify(params, loading, headers) {
    return _http("post", {
      url: "/ums/user/non-auth/platform/sign/ali/living/notify",
      apiName: "支付宝授权回调",
    }, params, loading, headers);
  },
};
